﻿// Notepad+
// (C) 2014 Jan Kowalewicz <kowalewicz.jan@live.de>
//
// StatusBarContextmenu.cs
// This file is part of the Notepad+ Project
//
// THIS PROJECT IS PUBLISHED UNDER THE TERMS OF THE LGPLv3

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using notepadplus.Dialogs;
using notepadplus.Properties;

namespace notepadplus.Dialogs.UserEditor
{
    public partial class StatusBarContextmenu : Form
    {
        public StatusBarContextmenu()
        {
            InitializeComponent();
        }

        private void StatusBarContextmenu_Load(object sender, EventArgs e)
        {
            // Load from settings
            langTB.Text = Settings.Default.StatusBarContextMenu_Header_Language;
            encodingTB.Text = Settings.Default.StatusBarContextMenu_Header_Encoding;
            eolTB.Text = Settings.Default.StatusBarContextMenu_Header_EOL;
            modeTB.Text = Settings.Default.StatusBarContextMenu_Header_EditMode;
            // ==== END ====
        }

        private void saveSettings_Click(object sender, EventArgs e)
        {
            // Save settings
            Settings.Default.StatusBarContextMenu_Header_Language = langTB.Text;
            Settings.Default.StatusBarContextMenu_Header_Encoding = encodingTB.Text;
            Settings.Default.StatusBarContextMenu_Header_EOL = eolTB.Text;
            Settings.Default.StatusBarContextMenu_Header_EditMode = modeTB.Text;
            Settings.Default.Save();
            // ==== END ====
            // information that the application needs to be restarted
            MessageBox.Show(this, "The modifications will be take over after an restart. Otherwise you can press 'Shift' and 'F9' to make an AutoRefresh!", "Notepad+", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void startManualEditorButton_Click(object sender, EventArgs e)
        {
            // TODO: give the manual editor the cookies!

            // Testing
            ManualEditor editor = new ManualEditor();
            editor.Show();
            // ==== END ====
        }
    }
}
